package com.example.springcloudfeign.contrrol;


import com.example.springcloudfeign.server.FeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignContrrol {
    @Autowired
    private FeignService feignServiceImpl;


    @RequestMapping("/feign")
    public String feign() {
        return  feignServiceImpl.feignService();
    }

    @RequestMapping("/feignWithParam")
    public String feignWithParam() {
        return  feignServiceImpl.feignWithParam();
    }


    /**
     * 降级处理
     * @return
     */
    @RequestMapping("/feignWithRestful")
    public String feignWithRestful() {
        return feignServiceImpl.feignWithRestful();
    }

    @RequestMapping("/returnRequestBody")
    public String feignWithRequestBodyDiaoYong() {
        return  feignServiceImpl.feignWithRequestBody() + "";
    }


    /**
     * 普通表单数据参数_调用
     * @return
     */
    @RequestMapping("/feignWithNormalFormData")
    public String feignWithNormalFormData() {
        return  feignServiceImpl.feignWithNormalFormData().toString();
    }


}
